<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>${category.name}</title>
</head>
<body>

Viewing all adverts in ${category.name} category
<br>
<table border="2">
	<thead>
		<tr>
			<td>Title</td>
			<td>Abstract Text</td>
			<td>File Path</td>
			<td>Phone Number</td>
			<td>Address</td>
			<td>Advertiser</td>
			<td>Key words</td>
		</tr>
	</thead>
	
	<tbody>
		<c:forEach items="${adverts}" var="currentAdvert">
			<tr>
				<td>${currentAdvert.title}</td>
				<td>${currentAdvert.abstractText}</td>
				<td>${currentAdvert.filePath}</td>
				<td>${currentAdvert.phoneNumber}</td>
				<td>${currentAdvert.address}</td>
				<td>${currentAdvert.advertiser.username}</td>
				<td>
					<c:forEach items="${currentAdvert.keyWords}" var="currentKeyWord">
						<c:out value="${currentKeyWord} "></c:out>
					</c:forEach>
				</td>
			</tr>
		</c:forEach>
	</tbody>
</table>
	

</body>
</html>